﻿using System.Web;

namespace Core.Helper
{
    public sealed class Cache
    {
        public static void Add(string key, object o)
        {
            HttpContext.Current.Cache.Insert(key, o);
        }

        public static object Get(string key)
        {
            return HttpContext.Current.Cache.Get(key);
        }

        public static void Remove(string key)
        {
            HttpContext.Current.Cache.Remove(key);
        }

        public static bool HasKey(string key)
        {
            return HttpContext.Current.Cache.Get(key) != null;
        }
    }
}